using KL.Standard.Model.ViewModels.Queue;

namespace KL.Standard.Domain.MessageQueue;

/// <summary>
/// 消息消费者
/// </summary>
public interface IBaseQueueConcumer<T>
{
    /// <summary>
    /// 启动MQ客户端
    /// </summary>
    void StartMQClient();

    /// <summary>
    /// 消费消息
    /// </summary>
    /// <param name="concumeAction"></param>
    /// <param name="logMsg"></param>
    /// <param name="queueName"></param>
    /// <typeparam name="K"></typeparam>
    void ConcumeMsg<K>(Func<MQueueItem<K>, bool> concumeAction, Action<MQueueItem<K>> logMsg, string queueName);
    /// <summary>
    /// 关闭客户端
    /// </summary>
    void CloseClient();
}